package com.javasm.adminapi.module.pricecheck.controller;

import com.javasm.adminapi.common.Parameter;
import com.javasm.adminapi.common.R;
import com.javasm.adminapi.module.pricecheck.entity.GgAdjustCheck;
import com.javasm.adminapi.module.pricecheck.service.GgAdjustCheckService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @className: CheckController
 * @description:
 * @author: lrg
 * @date: 2025/10/18 9:45
 * @version: 0.1
 * @since: jdk17
 */

@RestController
@RequestMapping("/check")
public class CheckController {


    @Resource
    GgAdjustCheckService checkService;
    @PostMapping("/agreeOrDisagree")
    public R agreeOrDisagree(GgAdjustCheck check){
        checkService.handleCheck(check);

        return  R.ok();
    }

    @GetMapping("/getReport")
    public R getReportByAdjustId(@RequestParam("adjustId") Integer adjustId){
        Parameter.check(adjustId);
        GgAdjustCheck check = checkService.getByAdjustId(adjustId);
        return R.ok(check);
    }
}
